<?php
	
	namespace Aspic\Form\Element;
	use Aspic\Security\Security as S;
	
	/**
	* DatePicker element (need jquery)
	*/
	class DatePicker extends Textbox {
		protected $_datePickerOptions;
	
		public function __construct($name, $label = '', $value = null, array $datePickerOptions = array(), array $attributes = array()) {
			parent::__construct($name, $label, $value, $attributes);
			
			$this->opt('datePickerOptions', $datePickerOptions);
		}
		
		public function outJs() {
			return '
			$(function() {
				$("#'.$this->attr('id').'").datepicker('.json_encode($this->opt('datePickerOptions')).');
			});
			';
		}

	}	
	
?>